/*
 Navicat MySQL Data Transfer

 Source Server         : 阿里云1
 Source Server Type    : MySQL
 Source Server Version : 50722
 Source Host           : 47.89.21.5
 Source Database       : chat

 Target Server Type    : MySQL
 Target Server Version : 50722
 File Encoding         : utf-8

 Date: 05/28/2018 08:16:17 AM
*/

SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `ecs_chat_msg`
-- ----------------------------
DROP TABLE IF EXISTS `ecs_chat_msg`;
CREATE TABLE `ecs_chat_msg` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '????',
  `content` text NOT NULL COMMENT '???????',
  `add_time` int(10) NOT NULL COMMENT '????',
  `content_type` varchar(20) DEFAULT 'text' COMMENT '????text,photo',
  PRIMARY KEY (`id`),
  KEY `add_time` (`add_time`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `ecs_chat_msg`
-- ----------------------------
BEGIN;
INSERT INTO `ecs_chat_msg` VALUES ('1', '<p>123</p>', '1523068054', 'text'), ('2', 'http://localhost/kf/kf/public/uploads/chat_msg/20180407/e6b34301ab14c18274d6f76a15f27dca.png', '1523068404', 'photo'), ('3', '<p>????</p>', '1527432535', 'text'), ('4', '<p>11<br/></p>', '1527433289', 'text'), ('5', '<p>1<br/></p><p><br/></p>', '1527433453', 'text'), ('6', '{\"total\":1,\"per_page\":7,\"current_page\":1,\"data\":[{\"id\":8,\"title\":\"???????\"}]}', '1527433453', 'OffLineText'), ('7', '\r\n                ???<span style=\'color:#0099ff\'>??????? </span><br>\r\n                ??????????????????<div><br><div><div>?????? 400 038 8383 ?<span style=\"color: inherit; line-height: 1.42857;\">??????181 2569 8945?????????</span></div></div></div>\r\n            ', '1527433617', 'text'), ('8', '<p>??<br/></p>', '1527434566', 'text'), ('9', '{\"total\":1,\"per_page\":7,\"current_page\":1,\"data\":[{\"id\":8,\"title\":\"???????\"}]}', '1527434566', 'OffLineText'), ('10', '\r\n                ???<span style=\'color:#0099ff\'>??????? </span><br>\r\n                ??????????????????<div><br><div><div>?????? 400 038 8383 ?<span style=\"color: inherit; line-height: 1.42857;\">??????181 2569 8945?????????</span></div></div></div>\r\n            ', '1527434568', 'text'), ('11', 'ang?', '1527434643', 'text'), ('12', '{\"total\":1,\"per_page\":7,\"current_page\":1,\"data\":[{\"id\":8,\"title\":\"???????\"}]}', '1527434643', 'OffLineText'), ('13', '\r\n                ???<span style=\'color:#0099ff\'>??????? </span><br>\r\n                ??????????????????<div><br><div><div>?????? 400 038 8383 ?<span style=\"color: inherit; line-height: 1.42857;\">??????181 2569 8945?????????</span></div></div></div>\r\n            ', '1527434646', 'text'), ('14', '<p><img src=\"http://img.baidu.com/hi/jx2/j_0025.gif\"/></p>', '1527434816', 'text'), ('15', '{\"total\":1,\"per_page\":7,\"current_page\":1,\"data\":[{\"id\":8,\"title\":\"???????\"}]}', '1527434816', 'OffLineText'), ('16', '\r\n                ???<span style=\'color:#0099ff\'>??????? </span><br>\r\n                ??????????????????<div><br><div><div>?????? 110 ?<span style=\"color: inherit; line-height: 1.42857;\">??????110?????????</span></div></div></div>\r\n            ', '1527434817', 'text');
COMMIT;

-- ----------------------------
--  Table structure for `ecs_chat_msg_user`
-- ----------------------------
DROP TABLE IF EXISTS `ecs_chat_msg_user`;
CREATE TABLE `ecs_chat_msg_user` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '??id',
  `fuser` varchar(250) NOT NULL COMMENT '???token',
  `tuser` varchar(250) NOT NULL COMMENT '???token',
  `msg_id` int(10) unsigned NOT NULL COMMENT '??id',
  `tu_skim` tinyint(1) NOT NULL COMMENT '????????1?0?',
  `fu_skim` tinyint(1) NOT NULL COMMENT '????????1?0?',
  `is_trace` tinyint(1) NOT NULL COMMENT '??????',
  PRIMARY KEY (`id`),
  KEY `fuser` (`fuser`),
  KEY `tuser` (`tuser`),
  KEY `msg_id` (`msg_id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `ecs_chat_msg_user`
-- ----------------------------
BEGIN;
INSERT INTO `ecs_chat_msg_user` VALUES ('1', 'da4b9237bacccdf19c0760cab7aec4a8359010b0', '356a192b7913b04c54574d18c28d46e6395428ab', '1', '1', '1', '0'), ('2', '356a192b7913b04c54574d18c28d46e6395428ab', 'da4b9237bacccdf19c0760cab7aec4a8359010b0', '2', '1', '1', '0'), ('3', '77de68daecd823babbb58edb1c8e14d7106e83bb', 'da4b9237bacccdf19c0760cab7aec4a8359010b0', '5', '0', '1', '0'), ('4', 'da4b9237bacccdf19c0760cab7aec4a8359010b0', '77de68daecd823babbb58edb1c8e14d7106e83bb', '6', '1', '0', '0'), ('5', 'da4b9237bacccdf19c0760cab7aec4a8359010b0', '77de68daecd823babbb58edb1c8e14d7106e83bb', '7', '1', '0', '0'), ('6', '1b6453892473a467d07372d45eb05abc2031647a', 'da4b9237bacccdf19c0760cab7aec4a8359010b0', '8', '0', '1', '0'), ('7', 'da4b9237bacccdf19c0760cab7aec4a8359010b0', '1b6453892473a467d07372d45eb05abc2031647a', '9', '1', '0', '0'), ('8', 'da4b9237bacccdf19c0760cab7aec4a8359010b0', '1b6453892473a467d07372d45eb05abc2031647a', '10', '1', '0', '0'), ('9', '1b6453892473a467d07372d45eb05abc2031647a', 'da4b9237bacccdf19c0760cab7aec4a8359010b0', '11', '0', '1', '0'), ('10', '1b6453892473a467d07372d45eb05abc2031647a', '1b6453892473a467d07372d45eb05abc2031647a', '12', '1', '1', '0'), ('11', 'da4b9237bacccdf19c0760cab7aec4a8359010b0', '1b6453892473a467d07372d45eb05abc2031647a', '13', '1', '0', '0'), ('12', '1b6453892473a467d07372d45eb05abc2031647a', 'da4b9237bacccdf19c0760cab7aec4a8359010b0', '14', '0', '1', '0'), ('13', 'da4b9237bacccdf19c0760cab7aec4a8359010b0', '1b6453892473a467d07372d45eb05abc2031647a', '15', '1', '0', '0'), ('14', 'da4b9237bacccdf19c0760cab7aec4a8359010b0', '1b6453892473a467d07372d45eb05abc2031647a', '16', '1', '0', '0');
COMMIT;

-- ----------------------------
--  Table structure for `ecs_config`
-- ----------------------------
DROP TABLE IF EXISTS `ecs_config`;
CREATE TABLE `ecs_config` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '??',
  `cKey` varchar(250) NOT NULL,
  `cValue` text NOT NULL,
  `type` varchar(20) NOT NULL DEFAULT 'text' COMMENT 'cValue???',
  PRIMARY KEY (`id`),
  UNIQUE KEY `cKey` (`cKey`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `ecs_config`
-- ----------------------------
BEGIN;
INSERT INTO `ecs_config` VALUES ('1', 'domain', 'http://kf.thkcat.com', 'text'), ('2', 'userPhotoOnLine', 'public/uploads/config/20170831/71e69e9505bd549174e3091e79556ff0.png', 'image'), ('3', 'userPhotoOffLine', 'public/uploads/config/20170831/ff2210754221cc0c877faba448201f4f.png', 'image'), ('4', 'kfPhotoOnLine', 'public/uploads/config/20170920/e1d2dcf106bf7c72124a4460165b7fee.png', 'image'), ('5', 'kfPhotoOffLine', 'public/uploads/config/20170919/5f8aec483a300ce01c23d83475bba97a.png', 'image'), ('7', 'domain_ip', 'ws://kf.thkcat.com:8282', 'text'), ('8', 'kfphone', '400-038-8383', 'text');
COMMIT;

-- ----------------------------
--  Table structure for `ecs_kf`
-- ----------------------------
DROP TABLE IF EXISTS `ecs_kf`;
CREATE TABLE `ecs_kf` (
  `kf_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `cate_id` int(11) unsigned NOT NULL,
  `kf_username` varchar(50) NOT NULL,
  `kf_password` varchar(50) NOT NULL,
  `kf_enc_string` varchar(250) NOT NULL,
  `nickname` varchar(50) NOT NULL DEFAULT '??' COMMENT '??',
  `motto` varchar(50) NOT NULL COMMENT '??',
  `is_admin` tinyint(1) NOT NULL DEFAULT '0' COMMENT '//?????',
  PRIMARY KEY (`kf_id`),
  UNIQUE KEY `kf_username` (`kf_username`),
  KEY `cate_id` (`cate_id`)
) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `ecs_kf`
-- ----------------------------
BEGIN;
INSERT INTO `ecs_kf` VALUES ('10', '1', 'ladygaga', '1bf4c0b554282b3f87dd04b0c6be37ad', 'BIDDLW2Anv9yzpc', 'ladygaga', '', '1'), ('12', '21', '???', '6a1e1a024ae1769ef2e469b174a4b195', 'acMrz1kxZUVhZrX', '???', '', '1');
COMMIT;

-- ----------------------------
--  Table structure for `ecs_kf_assess`
-- ----------------------------
DROP TABLE IF EXISTS `ecs_kf_assess`;
CREATE TABLE `ecs_kf_assess` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `client_id` int(11) NOT NULL COMMENT '//ecs_user??',
  `kf_id` int(11) NOT NULL COMMENT '//ecs_kf??',
  `cent` tinyint(1) NOT NULL DEFAULT '5' COMMENT '//1-5???',
  `add_time` varchar(11) NOT NULL COMMENT '//????',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='????';

-- ----------------------------
--  Table structure for `ecs_kf_cate`
-- ----------------------------
DROP TABLE IF EXISTS `ecs_kf_cate`;
CREATE TABLE `ecs_kf_cate` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(30) NOT NULL,
  `description` varchar(50) NOT NULL,
  `parent_id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `ecs_kf_cate`
-- ----------------------------
BEGIN;
INSERT INTO `ecs_kf_cate` VALUES ('21', '???', '', '0');
COMMIT;

-- ----------------------------
--  Table structure for `ecs_kf_reply`
-- ----------------------------
DROP TABLE IF EXISTS `ecs_kf_reply`;
CREATE TABLE `ecs_kf_reply` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '??id',
  `title` varchar(100) NOT NULL COMMENT '??',
  `content` text NOT NULL COMMENT '????',
  `sort` smallint(100) unsigned NOT NULL DEFAULT '1' COMMENT '??',
  `keywords` varchar(250) NOT NULL COMMENT '???',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `ecs_kf_reply`
-- ----------------------------
BEGIN;
INSERT INTO `ecs_kf_reply` VALUES ('8', '???????', '%E4%BA%B2%E7%88%B1%E7%9A%84%E5%AE%A2%E6%88%B7%EF%BC%8C%E4%BB%A5%E4%B8%8B%E6%96%B9%E5%BC%8F%E5%8F%AF%E4%BB%A5%E5%BF%AB%E9%80%9F%E6%89%BE%E5%88%B0%E6%88%91%EF%BC%9A%3Cdiv%3E%3Cbr%3E%3Cdiv%3E%3Cdiv%3E%E6%8B%A8%E6%89%93%E6%9C%8D%E5%8A%A1%E7%83%AD%E7%BA%BF%20110%20%EF%BC%8C%3Cspan%20style%3D%22color%3A%20inherit%3B%20line-height%3A%201.42857%3B%22%3E%E6%88%96%E6%B7%BB%E5%8A%A0%E5%BE%AE%E4%BF%A1%E5%8F%B7110%EF%BC%8C%E4%B9%9F%E5%8F%AF%E4%BB%A5%E7%AB%99%E5%86%85%E7%95%99%E8%A8%80%E3%80%82%3C%2Fspan%3E%3C%2Fdiv%3E%3C%2Fdiv%3E%3C%2Fdiv%3E', '1', '??');
COMMIT;

-- ----------------------------
--  Table structure for `ecs_mail`
-- ----------------------------
DROP TABLE IF EXISTS `ecs_mail`;
CREATE TABLE `ecs_mail` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '//??id',
  `title` varchar(100) NOT NULL COMMENT '????',
  `description` varchar(100) NOT NULL COMMENT '??',
  `content` text NOT NULL COMMENT '????',
  `is_read` tinyint(1) NOT NULL COMMENT '0??1??',
  `phone` varchar(20) NOT NULL COMMENT '????',
  `add_time` varchar(10) NOT NULL COMMENT '???',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COMMENT='???';

-- ----------------------------
--  Records of `ecs_mail`
-- ----------------------------
BEGIN;
INSERT INTO `ecs_mail` VALUES ('1', '??????????UV???????', '??????????UV???????', '%E6%96%B0%E5%BC%80%E5%AE%9E%E6%9C%A8%E9%97%A8%E5%8E%82%EF%BC%8C%E6%83%B3%E4%BA%86%E8%A7%A3UV%E6%BB%9A%E6%B6%82%E7%94%9F%E6%80%81%E6%B2%B9%E6%BC%86%E7%BA%BF%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20', '1', '18924568886', '1512471866'), ('13', '1', '1', '112222222222222233333333333333333333333333333333333334', '1', '18566360007', '1512472787');
COMMIT;

-- ----------------------------
--  Table structure for `ecs_malice_ip`
-- ----------------------------
DROP TABLE IF EXISTS `ecs_malice_ip`;
CREATE TABLE `ecs_malice_ip` (
  `id` tinyint(11) unsigned NOT NULL AUTO_INCREMENT,
  `ip` char(15) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `ip` (`ip`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `ecs_user`
-- ----------------------------
DROP TABLE IF EXISTS `ecs_user`;
CREATE TABLE `ecs_user` (
  `client_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '??id',
  `nickname` varchar(20) NOT NULL COMMENT '??',
  `client_secrect` varchar(250) NOT NULL COMMENT '????',
  `enc_string` varchar(250) NOT NULL COMMENT '?????',
  `enc_client_id` varchar(250) NOT NULL DEFAULT '' COMMENT 'client_id???',
  `kf_id` int(10) NOT NULL COMMENT 'kf????id',
  `ipcookie` varchar(40) NOT NULL,
  `ip` char(15) NOT NULL,
  PRIMARY KEY (`client_id`),
  UNIQUE KEY `id` (`client_id`),
  KEY `kf_id` (`kf_id`),
  KEY `ip` (`ipcookie`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Records of `ecs_user`
-- ----------------------------
BEGIN;
INSERT INTO `ecs_user` VALUES ('1', '??', 'Zbe6krjcbQWJq0FEGeKi', 'BEvRE0u8KrfwE9c', '356a192b7913b04c54574d18c28d46e6395428ab', '0', '0ef1c6c4844830f657ca95780146f5508883942c', '0.0.0.0'), ('2', '???', 'Hw6rTrrzISYGaeRhWCx5', 'P92x8eVCqwlLv8w', 'da4b9237bacccdf19c0760cab7aec4a8359010b0', '12', '', ''), ('3', '??', 'XWp92joDzneM9o6haCeO', 'UlgOgJ4vOLp9FJK', '77de68daecd823babbb58edb1c8e14d7106e83bb', '0', '121.33.60.12', '121.33.60.12'), ('4', '??', 'A4zF4bZRSeSWNEXKbHLX', 'rwE6dP8vUf2MzAg', '1b6453892473a467d07372d45eb05abc2031647a', '0', '419482033d452afb70e71836565510b5927d47a9', '121.33.60.12'), ('5', '??', 'tE9akfNnopaJB7RG0jwk', '0BHYWZIESHgG0ty', 'ac3478d69a3c81fa62e60f5c3696165a4e5e6ac4', '0', 'ae3c24cdcd52198dea793a068b223c806bd0bd5e', '121.33.60.12');
COMMIT;

-- ----------------------------
--  Table structure for `ecs_user_info`
-- ----------------------------
DROP TABLE IF EXISTS `ecs_user_info`;
CREATE TABLE `ecs_user_info` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `client_id` int(11) NOT NULL COMMENT 'ecs_user????',
  `name` varchar(50) NOT NULL COMMENT '??',
  `phone` varchar(50) NOT NULL COMMENT '????',
  `company` varchar(100) NOT NULL COMMENT '??',
  `remark` text NOT NULL COMMENT '??',
  `add_time` varchar(11) NOT NULL COMMENT '??',
  PRIMARY KEY (`id`),
  KEY `client_id` (`client_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `ecs_user_trace`
-- ----------------------------
DROP TABLE IF EXISTS `ecs_user_trace`;
CREATE TABLE `ecs_user_trace` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `ipcookie` varchar(40) NOT NULL,
  `url` varchar(255) NOT NULL,
  `info` varchar(255) NOT NULL,
  `add_time` int(10) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `ip` (`ipcookie`)
) ENGINE=MyISAM AUTO_INCREMENT=164836 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `ecs_wx_user`
-- ----------------------------
DROP TABLE IF EXISTS `ecs_wx_user`;
CREATE TABLE `ecs_wx_user` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `openId` varchar(100) NOT NULL COMMENT '????id',
  `nickName` varchar(50) NOT NULL COMMENT '??',
  `gender` varchar(1) NOT NULL COMMENT '0??1?2?',
  `city` varchar(250) NOT NULL COMMENT '??',
  `country` varchar(250) NOT NULL COMMENT '??',
  `province` varchar(200) NOT NULL COMMENT '??',
  `headImgUrl` varchar(250) NOT NULL COMMENT '??',
  `unionId` varchar(100) NOT NULL,
  `LoginToken` varchar(250) NOT NULL COMMENT '?????token',
  `user_id` int(11) NOT NULL COMMENT 'ecs_user???',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=MyISAM AUTO_INCREMENT=43 DEFAULT CHARSET=utf8;

SET FOREIGN_KEY_CHECKS = 1;
